<%--
  Created by IntelliJ IDEA.
  User: DELL
  Date: 2020/12/22
  Time: 18:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page import="java.sql.*" %>
<%--@ page import="com.chang.entity.Essay" --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>发布推文</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="ckeditor/ckeditor.js" type="text/javascript" ></script>
    <%--<script type="text/javascript" src="{{url_for('static',filename='ckeditor/ckeditor.js')}}"></script>--%>
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <!--script src="${pageContext.request.contextPath}/js/essay.js" type="text/javascript" ></script-->
    <style>
        #upload1{
            transform: translate(0,30%);
        }
        #btns{
            background-color: #ffa0a0;
            color:#b35e14;
            width: 100%;
            height:10%;
            align-content: center;
            text-align: center;
            margin: auto;
        }
        input[type="submit"]{
            transform: translate(0,10%);
        }
        span{
            color:#FFA0A0;
        }
        textarea{
            position: relative;
            margin-top: 20px;
            margin-left: 10px;
            margin-right: 10px;
        }
        div>input[type="text"]{
            width:300px;
        }
    </style>
</head>
<%String path = request.getContextPath();%>
<body>
<div style="margin: 30px">
    <form action="<%=path%>/insertEssay" method="post">
        <div id="primary" class="left-margin">
            <div id="essay-title" class="input-group">
                <div class="label-div">
                    <label for="title">标题</label>
                    <span class="must-span">*</span>
                    <input type="text" id="title" name="title" class="form-control" minlength="1" maxlength="20"
                           placeholder="标题字数不能超过20"/>
                    <small><span id="title-tip"></span></small>
                </div>
            </div>
            <div id="essay-author" class="input-group">
                <div class="label-div">
                    <label for="author">作者</label>
                    <span class="must-span">*</span>
                    <input type="text" id="author" name="author" class="form-control" minlength="1" maxlength="20"
                           placeholder="作者名字数不能超过20"/>
                    <small><span id="author-tip"></span></small>
                </div>
            </div>
            <div id="essay-type" class="input-group">
                <div class="label-div">
                    <label for="type">文章分类</label>
                    <span class="must-span">*</span>
                    <input type="text" id="type" name="type" class="form-control" minlength="1" maxlength="20"
                           placeholder="文章分类长度不能超过20"/>
                    <small><span id="type-tip"></span></small>
                </div>
            </div>
        </div>
        <textarea id="content" name="content" cols="10" rows="15">
            在此区域中在线编辑推文~
        </textarea>
        <div id="btns">
            <input id="upload1" name="upload1" class="btn btn-default" type="submit" value="发布推文">
            <!--input id="upload2" name="upload2" class="btn btn-default" type="button" value="预览" -->
        </div>
    </form>
</div>
<script type="text/javascript">
    CKEDITOR.replace('content',  {
        customConfig: '${pageContext.request.contextPath}/jsp/ckeditor/config.js',
        //清空预览区域显示内容
        image_previewText : "",
        //图片上传
        filebrowserUploadUrl : '${pageContext.request.contextPath}/img?',
    } );
</script>
</body>
</html>